import java.util.*;
public class of53 {
    public static void main(String[] args) {
        
    }
    public int search(int[] nums, int target) {
        int b=Arrays.binarySearch(nums, target);
        int i=b,j=b;
        while(nums[i]==target){
            i--;
        }
        while(nums[i]==target){
            j++;
        }
        if(b<0){
            return 0;
        }else return j-i+1;
        
    }
}
